﻿using System.Web;
using Actya.Core.Extensibility;
using Actya.Core.SiteStructure;

namespace Actya.Core.Infrastructure
{
	public interface ICmsHost
	{
		/// <summary>
		/// Gets or sets the application state.
		/// </summary>
		ApplicationState ApplicationState { get; set; }

		/// <summary>
		/// Gets or sets the host settings.
		/// </summary>
		HostSettings Settings { get; set; }

		/// <summary>
		/// The physical themes directory.
		/// </summary>
		string PhysicalThemesDirectory { get; }

		/// <summary>
		/// Gets or sets the cache.
		/// </summary>
		ICache Cache { get; set; }

		/// <summary>
		/// Gets the available themes by scanning the Themes directory, except the admin theme.
		/// </summary>
		/// <returns></returns>
		Theme[] GetAvailableThemes();

		/// <summary>
		/// Gets a theme object for the given name.
		/// </summary>
		/// <param name="name"></param>
		/// <returns></returns>
		Theme GetTheme(string name);

		/// <summary>
		/// Gets the available plugins by scanning the Plugins directory.
		/// </summary>
		PluginType[] GetAvailablePluginTypes();

		/// <summary>
		/// Indicates if the application runs in Medium Trust.
		/// </summary>
		bool IsMediumTrust { get; }

		/// <summary>
		/// The maximum request size in kbytes.
		/// </summary>
		int MaxRequestSize { get; }

		/// <summary>
		/// The physical plugins directory.
		/// </summary>
		string PhysicalPluginsDirectory { get; }

		/// <summary>
		/// Force appdomain recycle
		/// </summary>
		void RestartApplication(HttpContextBase context);
	}
}